Skip to content

Replace phpcs exceptions with phpcs disable comments wrapped around i…#2882

Merged
Crabcyborg merged 13 commits into
masterfrom
replace_phpcs_exceptions_with_phpcs_disable_comments
Jan 26, 2026
Merged

Replace phpcs exceptions with phpcs disable comments wrapped around i…#2882
Crabcyborg merged 13 commits into
masterfrom
replace_phpcs_exceptions_with_phpcs_disable_comments

Conversation

@Crabcyborg

@Crabcyborg Crabcyborg commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

…nline HTML

This way we're not ignoring indentation issues in some of these large files.

Summary by CodeRabbit

  • Style

    • Applied widespread formatting and lint-suppression adjustments to improve consistency across many UI output areas.
  • Chores

    • Reconfigured code-quality rules to change which files are checked and tightened formatting enforcement.
  • New Features

    • Added clickable entry links in Stripe payments and ensured the form builder popup initializes the editor when needed.

✏️ Tip: You can customize this high-level summary in your review settings.

@Crabcyborg Crabcyborg added this to the 6.28 milestone Jan 26, 2026
@coderabbitai

coderabbitai Bot commented Jan 26, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR primarily adds PHP_CodeSniffer indentation suppression/restore comments around many HTML/PHP output blocks and adjusts phpcs.xml ScopeIndent excludes. One controller (FrmFormsController::insert_form_popup) conditionally initializes and renders the WP editor when needed.

Changes

Cohort / File(s) Summary
PHPCS config
phpcs.xml
Reworked Generic.WhiteSpace.ScopeIndent exclude-patterns, shifting which files are linted for scope indentation.
Controllers
classes/controllers/...
\classes/controllers/FrmAddonsController.php`, `classes/controllers/FrmAppController.php`, `classes/controllers/FrmFormsController.php`, `classes/controllers/FrmSMTPController.php`, `classes/controllers/FrmStylesController.php`, `classes/controllers/FrmWelcomeTourController.php``
Wrapped multiple HTML/JS output blocks with // phpcs:disable Generic.WhiteSpace.ScopeIndent / // phpcs:enable comments. FrmFormsController::insert_form_popup also conditionally loads/renders the WP editor when the form-builder page lacks _WP_Editors.
Core helpers
classes/helpers/...
\classes/helpers/FrmAddonsHelper.php`, `classes/helpers/FrmAppHelper.php`, `classes/helpers/FrmDashboardHelper.php`, `classes/helpers/FrmEntriesHelper.php`, `classes/helpers/FrmEntriesListHelper.php`, `classes/helpers/FrmFieldsHelper.php`, `classes/helpers/FrmFormMigratorsHelper.php`, `classes/helpers/FrmFormTemplatesHelper.php`, `classes/helpers/FrmFormsHelper.php`, `classes/helpers/FrmFormsListHelper.php`, `classes/helpers/FrmHtmlHelper.php`, `classes/helpers/FrmListHelper.php`, `classes/helpers/FrmOnSubmitHelper.php``
Inserted PHPCS indentation suppression/restore comments around multiple HTML/PHP output blocks; no logic or control-flow changes.
UI / styles helpers
classes/helpers/...
\classes/helpers/FrmStylesCardHelper.php`, `classes/helpers/FrmStylesHelper.php`, `classes/helpers/FrmTipsHelper.php``
Added PHPCS scope indentation disable/enable comments around UI/style rendering sections only.
Models & fields
classes/models/... & classes/models/fields/...
\classes/models/FrmFormAction.php`, `classes/models/FrmFormMigrator.php`, `classes/models/FrmHoneypot.php`, `classes/models/FrmSalesApi.php`, `classes/models/FrmSolution.php`, `classes/models/fields/FrmFieldName.php`, `classes/models/fields/FrmFieldPhone.php`, `classes/models/fields/FrmFieldType.php``
Added PHPCS indentation suppression/restore comments around HTML/PHP blocks; no behavioral changes.
Widgets / core files
classes/widgets/...
\classes/widgets/FrmShowForm.php`, `classes/models/FrmEntryMeta.php`, `classes/models/FrmField.php``
PHPCS suppression comments added around rendering/logic blocks; a few long boolean expressions were compacted to single-line forms with phpcs ignore comments. No signature changes.
Payments / integrations
stripe/..., square/...
\stripe/controllers/FrmTransLitePaymentsController.php`, `stripe/helpers/FrmStrpLiteAppHelper.php`, `stripe/helpers/FrmStrpLiteConnectHelper.php`, `stripe/helpers/FrmTransLiteAppHelper.php`, `stripe/models/FrmTransLiteAction.php`, `square/helpers/FrmSquareLiteConnectHelper.php``
Wrapped HTML/currency/rendering blocks with PHPCS directives; Stripe payments controller also inserts an anchor link rendering for payment entries.
Manifest / packaging
composer.json
Listed in manifest changes; no functional edits.

Sequence Diagram(s)

(Skipped — changes are largely PHPCS directive additions and small conditional editor initialization not warranting a sequence diagram.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #2801 — Related phpcs.xml / coding-standard reconfiguration affecting which files are linted.
  • #2791 — Overlaps with edits to FrmEntryMeta::getAll (query handling-related PR).
  • #2676 — Overlapping PHPCS/formatting changes across many of the same files (controllers, helpers, models).

Poem

🐰
I nibbled tabs and munched on space,
PHPCS tidy—everyplace.
A little rabbit hopped through code at night,
Wrapping markup gently, keeping lint polite.
Hooray for order — tidy hops, delight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: replacing phpcs exceptions with phpcs disable comments wrapped around inline HTML across the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 98.59% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@phpcs.xml`:
- Around line 241-256: The global phpcs ScopeIndent excludes list contains
redundant entries and missing inline suppressions: add targeted inline disables
(phpcs:disable Generic.WhiteSpace.ScopeIndent ... phpcs:enable) in the five
files that currently lack them—classes/models/FrmFieldTextarea.php,
classes/models/FrmEntryMeta.php, classes/controllers/FrmFieldsController.php,
classes/models/FrmPluginSearch.php, and
stripe/helpers/FrmTransLiteListHelper.php—and then remove the now-redundant
<exclude-pattern> entries for the seven files that already include inline
suppressions (classes/helpers/FrmStylesCardHelper.php,
classes/helpers/FrmFormsListHelper.php,
stripe/helpers/FrmTransLiteAppHelper.php, classes/helpers/FrmStylesHelper.php,
classes/models/FrmSolution.php, classes/controllers/FrmFormsController.php,
classes/helpers/FrmFormsHelper.php) from phpcs.xml so the project relies on
file-local suppressions only.

Comment thread phpcs.xml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@classes/helpers/FrmAppHelper.php`:
- Around line 855-857: The phpcs suppression comment above the $_REQUEST access
is duplicated ("phpcs:ignore phpcs:ignore ...") so the sniff suppression may not
work; edit the comment in the FrmAppHelper code block that contains the
isset($_REQUEST[$args['param']]) check and the $value = wp_unslash(...) line to
use a single phpcs:ignore token—e.g. change it to "// phpcs:ignore
WordPress.Security.NonceVerification.Missing,
WordPress.Security.ValidatedSanitizedInput.InputNotSanitized" (or use a single
appropriate phpcs directive) so the intended sniffs are properly suppressed.

Comment thread classes/helpers/FrmAppHelper.php
@Crabcyborg
Crabcyborg merged commit 3819e64 into master Jan 26, 2026
26 checks passed
@Crabcyborg
Crabcyborg deleted the replace_phpcs_exceptions_with_phpcs_disable_comments branch January 26, 2026 18:16
stephywells pushed a commit that referenced this pull request Apr 4, 2026
…h_phpcs_disable_comments

Replace phpcs exceptions with phpcs disable comments wrapped around i…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant